﻿@model System.Collections.Generic.List<KRM.Core.tblConsignmentNoAndDriverComment>

@{
    ViewBag.Title = "Confirm Delivery - " + ViewBag.LoadCode;
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
}

<div style="padding: 10px">
    @Html.Partial("Partial/_MessageResult")
    <form action="/load/saveandconfirmdelivery" method="POST">
        <input type="hidden" name="LoadId" value="@ViewBag.LoadId"/>
        @if (ViewBag.IsHub)
        {
            <div class="row-fluid">
                <div class="span3">Select delivery date</div>
                <div class="span3">
                    <div class="input-append datetimepicker">
                        <input data-format="MM/dd/yyyy" type="text" name="deliverydate" value="@DateTime.Now.ToString("MM/dd/yyyy")" required="required" style="width: 80%">
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>
                <div class="span3">
                    <input type="checkbox" name="sendmail" checked="checked" value="1" /> Send Email
                </div>
            </div>}
        <div class="row-fluid">
            <table class="table table-bordered table-fix">
                <thead>
                    <tr>
                        <td>OrderRef</td>
                        <td>Consnumber</td>
                        <td>DeliveryComments</td>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.OrderRef<input type="hidden" name="OrderItemId" value="@item.OrderItemID"/></td>
                            <td>
                                <input type="text" value="@item.ConsignmentNumber" name="ConsignmentNumber" class="input-block-level"/></td>
                            <td>
                                <input type="text" value="@item.DriverComments" name="DriverComments" class="input-block-level"/></td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
        <div class="row-fluid">
            <button type="submit" class=" btn btn-primary">Save And Confirm</button>
        </div>
    </form>
</div>
